#encoding=utf-8
from appium import webdriver

class Appium_Driver():

    def __init__(self):
        desired_caps = {
            'platformName': 'Android',
            'deviceName': 'CLB0218424000058',  # 华为Note8 8DF6R16729019152  #华为P20  CLB0218424000058
            'platformVersion': '8.1.0',
            'appPackage': 'com.tencent.mm',
            'appActivity': '.ui.LauncherUI',
            'noReset': 'True',
            'unicodeKeyboard': 'True',
            'resetKeyboard':'True' ,
            'automationName': 'appium',
            'chromeOptions': {'androidProcess': 'com.tencent.mm:appbrand0'},
            'recreateChromeDriverSessions': 'True'  # 解决这个报错Could not proxy command to remote server

        }
        self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)
        print("启动成功")

    def getDriver(self):
        return self.driver
